var layerId;
$(function(){
	$("#search-button").click(function(){
		var keyword=$("input[name='keyword']").val();
		var isChecked=$("select[name='isChecked']").val();
		var url=basePath+"/topic/query.shtml?pageNo=1"+"&keyword="+keyword+"&isChecked="+init.isChecked;
		window.location.href=url;
	});
	$("#addTopic-button").click(function(){
		layerId=layer.open({
			title: "新增话题",
			area: ['1200px','700px'],
			fix:true,
			type: 2,
			content: basePath+'/topic/add.shtml'
		});
	})
})
function fanye(pageNo){
	var url=basePath+"/topic/query.shtml?pageNo="+pageNo+"&keyword="+init.keyword+"&isChecked="+init.isChecked;
	window.location.href=url;
}
function editFun(topicId){
	layerId=layer.open({
		title: "修改话题",
		area: ['1200px','700px'],
		fix:true,
		type: 2,
		content: basePath+'/topic/edit.shtml?topicId='+topicId
	});
}
function checkFun(topicId,status){
	if(confirm("确认审核？")){
		 $.ajax({
	  		 url:basePath+"/topic/checkStatus.shtml?topicId="+topicId+"&status="+status,  
	  		 type:"post",
	  		 dataType:"JSON",
	  		 success:ajaxSuccessRefreshFun
	  	 });
	}
}
function deleteFun(topicId){
	if(confirm("确认删除？")){
		 $.ajax({
	  		 url:basePath+"/topic/delete.shtml?topicId="+topicId,  
	  		 type:"post",
	  		 dataType:"JSON",
	  		 success:ajaxSuccessRefreshFun
	  	 });
	}
}